// Example code that deserializes and serializes the model.
// extern crate serde;
// #[macro_use]
// extern crate serde_derive;
// extern crate serde_json;
//
// use generated_module::RealResult;
//
// fn main() {
//     let json = r#"{"answer": 42}"#;
//     let model: RealResult = serde_json::from_str(&json).unwrap();
// }

use serde::{Serialize, Deserialize};

/// 实时成绩
#[derive(Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RealResult {
    /// 头部数据
    head: Head,

    /// 主体数据
    body: Body,
}

/// 主体数据
#[derive(Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Body {
    /// 代表队/代表团/俱乐部
    team: String,

    /// 运动员姓名
    athlete_name: String,

    /// 运动员号码
    athlete_bib: String,

    /// 运动员联系方式
    athlete_telephone: String,

    /// A线成绩
    result_a: String,

    /// B线成绩
    result_b: String,

    /// 排名
    rank: String,
}

/// 头部数据
#[derive(Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Head {
    /// 设备Id
    device_id: String,

    /// 消息Uuid
    message_uuid: String,

    /// 发送消息的时间。格式：yyyy-MM-dd HH:mm:ss.fff 比如：2020-09-02 12:24:09.923
    timestamp: String,

    /// 消息类型
    message_type: String,
}
